/**
 * @Auther: ChenforCode
 * @Date: 2018/9/11 12:07
 * @Description:
 */
package cn.chenforcode.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Time;
import java.util.Date;

@Entity
public class Book {
    private String bno;
    private String bname;
    private String author;
    private String pbhouse;
    private long total;
    private long still;

    @Id
    @Column(name = "BNO")
    public String getBno() {
        return bno;
    }

    public void setBno(String bno) {
        this.bno = bno;
    }

    @Basic
    @Column(name = "BNAME")
    public String getBname() {
        return bname;
    }

    public void setBname(String bname) {
        this.bname = bname;
    }

    @Basic
    @Column(name = "AUTHOR")
    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    @Basic
    @Column(name = "PBHOUSE")
    public String getPbhouse() {
        return pbhouse;
    }

    public void setPbhouse(String pbhouse) {
        this.pbhouse = pbhouse;
    }

    @Basic
    @Column(name = "TOTAL")
    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    @Basic
    @Column(name = "STILL")
    public long getStill() {
        return still;
    }

    public void setStill(long still) {
        this.still = still;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Book book = (Book) o;

        if (total != book.total) return false;
        if (still != book.still) return false;
        if (bno != null ? !bno.equals(book.bno) : book.bno != null) return false;
        if (bname != null ? !bname.equals(book.bname) : book.bname != null) return false;
        if (author != null ? !author.equals(book.author) : book.author != null) return false;
        if (pbhouse != null ? !pbhouse.equals(book.pbhouse) : book.pbhouse != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = bno != null ? bno.hashCode() : 0;
        result = 31 * result + (bname != null ? bname.hashCode() : 0);
        result = 31 * result + (author != null ? author.hashCode() : 0);
        result = 31 * result + (pbhouse != null ? pbhouse.hashCode() : 0);
        result = 31 * result + (int) (total ^ (total >>> 32));
        result = 31 * result + (int) (still ^ (still >>> 32));
        return result;
    }

    public Book(String bno, String bname, String author, String pbhouse, long total, long still) {
        this.bno = bno;
        this.bname = bname;
        this.author = author;
        this.pbhouse = pbhouse;
        this.total = total;
        this.still = still;
    }

    public Book() {
    }

    @Override
    public String toString() {
        return "Book{" +
                "bno='" + bno + '\'' +
                ", bname='" + bname + '\'' +
                ", author='" + author + '\'' +
                ", pbhouse='" + pbhouse + '\'' +
                ", total=" + total +
                ", still=" + still +
                '}';
    }
}
